package com.example.selfcontrol.dto;

import com.example.selfcontrol.entity.Article;
import lombok.Data;

import java.util.Date;

@Data
public class ArticleRespDTO {

    private String title ;
    private String content ;

    private Date createtime ;

    private Integer up ;

    private Integer down ;

    private Integer stars ;

    private Long articleCategory ;

    private Long authorId ;

    // Star | Like
    private boolean isStar ;

    private boolean isLike ;

    private int LikeNumber ;

    public ArticleRespDTO(Article article, boolean isStar, boolean isLike, int likeNumber) {
        this.title = article.getTitle();
        this.content = article.getContent();
        this.createtime = article.getCreatetime();

        this.articleCategory = article.getArticleCategory();
        this.authorId = article.getAuthorId();

        this.isStar = isStar;
        this.isLike = isLike;
        this.LikeNumber = likeNumber;
    }
}
